import Vue from 'vue';
import Router from 'vue-router';
import List from '../views/List.vue'; 
import UserList from '../views/UserList.vue'; 
import Home from '../views/Home.vue'; 

import Login from '@/views/LoginView.vue';
import Register from '@/views/RegisterView.vue';
Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home,
      redirect: '/novel', // 默认重定向到小说页面
      children: [
        {
          path: '/novel',
          name: 'NovelList',
          component: List
        },
        {
          path: '/user',
          name: 'UserList',
          component: UserList
        }
      ]
    },
    // {
    //   path: '/',
    //   name: 'Login',
    //   component: Login
    // },

    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    }

  ]
});